//
//  UIView+GG.h
//  unzip
//
//  Created by yg on 2021/11/15.
//

#import <UIKit/UIKit.h>


@interface UIView (GG)

@property (nonatomic, readonly) CGRect gg_absoluteFrame;
@property (nonatomic) CGFloat gg_left;    //x
@property (nonatomic) CGFloat gg_top;     //y
@property (nonatomic) CGFloat gg_width;   //w
@property (nonatomic) CGFloat gg_height;  //h
@property (nonatomic) CGFloat gg_right;   //x+w
@property (nonatomic) CGFloat gg_bottom;  //y+h
@property (nonatomic) CGFloat gg_centerX; //x+w/2
@property (nonatomic) CGFloat gg_centerY; //y+h/2
@property (nonatomic) CGPoint gg_origin;  //(x,y)
@property (nonatomic) CGSize  gg_size;    //(w,h)

- (void)gg_removeAllSubviews;
- (UIViewController *_Nullable)gg_viewController;
- (UIImage *_Nullable)gg_screenshotImage;
-(void)gg_cornerRadius: (CGFloat)radius
		   borderWidth: (CGFloat)width
				 color: (UIColor *_Nullable)color;
-(void)gg_shadowWithColor: (UIColor *_Nullable)color
				   offset: (CGSize)offset
				  opacity: (CGFloat)opacity
				   radius: (CGFloat)radius;

@end

#pragma mark - 添加手势
typedef void (^GestureActionBlock)(UIGestureRecognizer * _Nullable gestureRecoginzer);
@interface UIView (GGGestures)

- (void)gg_addTapActionWithBlock:(GestureActionBlock _Nullable )block;
- (void)gg_addLongPressActionWithBlock:(GestureActionBlock _Nullable )block;

@end

